﻿<navigation:Page 
    x:Class="ibba.src.norisk.PageContrato"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:src="clr-namespace:ibba.src.norisk" 
    xmlns:slc="clr-namespace:ibba.src.slcomponentes;assembly=ibba.src.slcomponentes"
    mc:Ignorable="d"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" Title="Parametrização de Contrato" d:DesignHeight="480" d:DesignWidth="800">

    <navigation:Page.Resources>
        <src:ConverterUsaProcessamento x:Key="BackgroundUP" />
    </navigation:Page.Resources>

    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" 
         VerticalAlignment="Stretch" Background="#FFFFFFFF" Margin="0,0,0,0"  >

        <toolkit:BusyIndicator x:Name="activity">
            <Grid>

                <Grid.RowDefinitions >
                    <RowDefinition Height="52" />
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Grid  Grid.Row="0" 
		       Background="#FF5C7590" VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions >
                        <ColumnDefinition Width="233" />
                        <ColumnDefinition Width="187"/>
                        <ColumnDefinition Width="169"/>
                        <ColumnDefinition/>

                    </Grid.ColumnDefinitions>

                    <Border CornerRadius="10" Background="#FFDEDEDE" 
			Margin="15,6,0,0" Height="28" VerticalAlignment="Top"  >
                        <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Height="28">
                            <TextBlock  Text="Buscar por" 
                		Foreground="#FF14517B" Margin="10,0,0,0" Height="16"/>
                            <TextBlock x:Name="txtTipoPesquisa" 
                		Margin="5,6,0,6" Width="140"
                		Text = "Contrato"
                     />
                        </StackPanel>
                    </Border>

                    <sdk:AutoCompleteBox x:Name="txtPesquisa" 
                                           Grid.Column="1" 
                                           FontSize="14" 
                                           IsTabStop="True"
                                           KeyUp="txtPesquisa_KeyDown" FilterMode="Contains"
                                           Margin="10,6,-41,0" VerticalAlignment="Top" Height="28" />
                    <Button x:Name="btnPesquisarGrupo" 
                    Grid.Column="2"  
					Margin="45,6,0,0" 
					Width="100" 
                    HorizontalAlignment="Left"
                    Click="btnPesquisar_Click" VerticalAlignment="Top" Height="28" >

                        <StackPanel Orientation="Vertical" Margin="-55,-3,-52,0" Width="100" Height="26">
                            <Image Source="../image/search.png" Width="20" 
							HorizontalAlignment="Left"
							Margin="5,4,0,7" />
                            <TextBlock Text="Pesquisar" Margin="35,-25,8,0" FontSize="12"/>
                        </StackPanel>

                    </Button>

                    <StackPanel Orientation="Horizontal" Width="160" Height="40" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Right">
                        <Image  Margin="0,0,0,0" Width="160" Height="40" Source="../image/etq_confidencial_restrita.png" />
                    </StackPanel>

                </Grid>

                <Grid  Grid.Row="1" Margin="7,21,7,47" Background="#FFFFFFFF" ShowGridLines="False" Grid.RowSpan="3">
                    <Grid.ColumnDefinitions >
                        <ColumnDefinition Width="316"/>
                        <ColumnDefinition Width="432" />
                        <ColumnDefinition Width="0" />
                        <ColumnDefinition Width="0" />
                        <ColumnDefinition Width="277"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock 
        	Text="Parametrizações" 
        	FontSize="14"
        	Foreground="#FFC4991C" 
        	VerticalAlignment="Top" Width="Auto" 
        	HorizontalAlignment="Left" FontFamily="Verdana" Margin="9,2,0,0" d:LayoutOverrides="GridBox" />

                    <sdk:DataGrid x:Name="grdContrato" 
                        Margin="9,26,0,27" RenderTransformOrigin="0.5,0.5" 
                        Visibility="Visible" MinHeight="200" 
                        Background="#00000000" AlternatingRowBackground="#FFFCFCFC" 
                        RowBackground="#FFFCFCFC" AutoGenerateColumns="False" 
                        IsReadOnly="True" BorderBrush="#FFF8F8F8" 
                        HorizontalScrollBarVisibility="Hidden" HorizontalAlignment="Left" Grid.ColumnSpan="2">
                        <sdk:DataGrid.Columns>
                            <sdk:DataGridTextColumn Header="Id" Width="1" Binding="{Binding Path=Id}" Visibility="Collapsed" />
                            <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Grupo Econômico" MinWidth="240" Width="240">
                                <sdk:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                            <TextBlock Text="{Binding Path=NomGrupoCliente}" />
                                        </Border>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellTemplate>
                            </sdk:DataGridTemplateColumn>
                            <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Cliente" MinWidth="240" Width="240">
                                <sdk:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                            <TextBlock Text="{Binding Path=NomCliente}" />
                                        </Border>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellTemplate>
                            </sdk:DataGridTemplateColumn>
                            <sdk:DataGridTemplateColumn IsReadOnly="True" Header="Contrato" MinWidth="200" Width="200">
                                <sdk:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Border Background="{Binding Path=UsaProcessamento, Converter={StaticResource BackgroundUP}}">
                                            <TextBlock Text="{Binding Path=CodContrato}" />
                                        </Border>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellTemplate>
                            </sdk:DataGridTemplateColumn>
                            <sdk:DataGridTemplateColumn Width="20">
                                <sdk:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button x:Name="btnDetalhe" Click="btnDetalhe_Click">
                                            <StackPanel Orientation="Vertical">
                                                <Image Source="../image/edit.png" Stretch="None" Width="16" Height="16"/>
                                            </StackPanel>
                                        </Button>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellTemplate>
                            </sdk:DataGridTemplateColumn>
                        </sdk:DataGrid.Columns>
                    </sdk:DataGrid>

                    <!-- Margin="150,200,-180,92"  -->


                </Grid>

                <!--<slc:ControlMenuBar x:Name="barraMenu" Grid.Row="3" Height="85" VerticalAlignment="Bottom" TitleBar="Menu"
							User="[Usuario]" />-->
            </Grid>
        </toolkit:BusyIndicator>
    </Grid>

</navigation:Page>
